Skip to content

feat: @speechify/vercel — Speechify provider for the Vercel AI SDK (bridge over @speechify/api) - #1

Merged
vrishab-jpg merged 5 commits into
masterfrom
feat/initial-provider
Jul 6, 2026
Merged

feat: @speechify/vercel — Speechify provider for the Vercel AI SDK (bridge over @speechify/api)#1
vrishab-jpg merged 5 commits into
masterfrom
feat/initial-provider

Conversation

@vrishab-jpg

@vrishab-jpg vrishab-jpg commented Jul 3, 2026

Copy link
Copy Markdown
Collaborator

What this is

A Speechify TTS provider for the Vercel AI SDK — developers get Speechify speech generation with the same one-line interface as OpenAI / ElevenLabs / Deepgram:

import { speechify } from '@speechify/vercel';
import { generateSpeech } from 'ai';

const { audio } = await generateSpeech({
  model: speechify.speech('simba-english'),
  text: 'Hello!',
});

No Speechify provider exists on npm or the AI SDK community providers list today — the slot is open. ElevenLabs and Deepgram are already first-class there.

Architecture

The provider is a thin bridge over the official @speechify/api client — no hand-rolled HTTP or duplicated wire types. It only:

  • maps AI SDK call options (text, voice, speed, outputFormat, providerOptions) onto Speechify.GetSpeechRequest,
  • converts SpeechifyErrorAPICallError (user aborts re-thrown as the original AbortError so AI SDK retry/abort semantics hold),
  • disables the SDK's internal retries (maxRetries: 0) because the AI SDK applies its own retry policy on top.

One deliberate extension: the live API accepts codec strings (pcm_16000, mp3_24000_128, ulaw_8000) via output_format, verified live, but @speechify/api@2.0.0's GetSpeechRequest doesn't have the field yet — the type is extended locally until the next SDK generation picks it up. Base URL defaults to the SDK's environment (api.speechify.ai).

Naming (per the Slack conventions)

  • npm package: @speechify/vercel
  • repo: Speechify-AI/vercel-sdk — transferred from SpeechifyInc/speechify-api-sdk-vercel on 2026-07-06 (GitHub redirects all old URLs).

State

Code-complete and tested. Implements the current SpeechModelV4 spec (ai@7) against POST /v1/audio/speech. TTS only — the API has no STT endpoint to wrap.

  • ✅ Typecheck clean, 20/20 unit tests pass (incl. a guard that the bridge never double-retries), tsup build green (ESM+CJS+types), npm publish --dry-run clean
  • Smoke test passed against the live API through the bridge (2026-07-06) with the defaults — model simba-3.2, voice geffen_32: mp3 generated, speech marks + billable count correct, bad-key path raises a clean AI_APICallError. (Earlier pre-bridge run also live-verified codec output_format pcm_16000, SSML passthrough, and speed→prosody wrap.) Defaults note: the simba-3.2 curated voice set was pulled live from /v1/voices (8 voices, *_32); geffen_32 chosen as the en-US voice with the broadest use-case tags.
  • ✅ Release setup mirrors speechify-api-sdk-typescript: release-please on master, pnpm/corepack Node 24, OIDC provenance publish. One fix over the SDK repo: src/version.ts carries the x-release-please-version annotation so version stamping actually works

Design notes: speed is implemented via SSML <prosody> wrap (the API has no speed param); word-timing speech marks are exposed via providerMetadata.speechify. Full surface in the README.

Remaining steps (permission-gated — @luke-speechify)

  1. Merge this PR (smoke test already re-run post-refactor with the final defaults, passing).
  2. Transfer the repo — done 2026-07-06, this is now Speechify-AI/vercel-sdk.
  3. First npm publish (must be manual once — trusted publishing can't be pre-configured for a package that doesn't exist): with @speechify scope rights, pnpm build && npm publish --access public.
  4. Configure trusted publishing on npmjs.com → @speechify/vercel → Trusted Publisher: repo Speechify-AI/vercel-sdk, workflow release-please.yml. After that, releases are fully automated (merge release-please PR → CI publishes with provenance), same as @speechify/api. Note: repo needs to be flipped public for provenance — it's private pending your review.
  5. Community listing: PR a page to vercel/ai under content/providers/05-community-providers/ (copy the structure of 41-soniox.mdx, another speech-only provider). Vercel explicitly welcomes these PRs — no approval gate.

Questions → Vrishab.

Implements the AI SDK SpeechModelV4 specification (generateSpeech, ai@7)
against POST /v1/audio/speech. TTS only; the API has no STT endpoint.

- createSpeechify / speechify provider factory, SPEECHIFY_API_KEY auth
- models: simba-english (default), simba-multilingual, simba-3.0
- outputFormat: simple names (mp3, wav, ...) and codec strings (pcm_16000, ...)
- speed implemented via SSML prosody wrap; SSML input passed through
- speech marks + billable character count via providerMetadata.speechify
- release-please + provenance publish workflow mirroring speechify-api-sdk-typescript

@luke-speechify luke-speechify left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lets make sure this follows the naming conventions laid out in the Slack channel. also i'd like this to be a bridge using the @speechify/api package. Zod types are great, but lets map rather than re-invent

…chify/vercel

- Replace hand-rolled fetch + zod wire schemas with the official
  @speechify/api client; the provider now only maps AI SDK call
  options onto SDK types.
- Derive model id / audio format / request types from the SDK
  (output_format codec strings extended locally until the generated
  type catches up with the live API).
- Convert SpeechifyError to APICallError (retry semantics preserved,
  user aborts re-thrown as the original AbortError); SDK-internal
  retries disabled since the AI SDK owns retry policy.
- Default base URL now follows the SDK environment (api.speechify.ai).
- Rename package to @speechify/vercel per the speechify-ai org naming
  convention; repository moves to speechify-ai/vercel-sdk.
@vrishab-jpg vrishab-jpg changed the title feat: Speechify speech provider for the Vercel AI SDK feat: @speechify/vercel — Speechify provider for the Vercel AI SDK (bridge over @speechify/api) Jul 5, 2026
Dweeb1578 added 2 commits July 6, 2026 20:02
simba-3.2 is the recommended Simba 3 model in the current API spec
(streaming-native, lower TTFB); "simba" is a shared voice in its
curated set. simba-3.2 is added to the model id union explicitly since
the generated SDK type does not include it yet.
Live /v1/voices check: the simba-3.2 curated set is beatrice_32,
dominic_32, edmund_32, geffen_32, harper_32, hugh_32, imogen_32,
wyatt_32 (george only supports the 1.6 models). geffen_32 is the en-US
voice with the broadest use-case coverage. Live smoke test passes with
the defaults.
@vrishab-jpg
vrishab-jpg merged commit 5cf64e1 into master Jul 6, 2026
4 checks passed
@vrishab-jpg
vrishab-jpg deleted the feat/initial-provider branch July 6, 2026 21:26
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants